package com.ruoyi.system.domain;

import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.zbg.ToDoVo;

import java.io.Serializable;
import java.util.List;

public class PageReturnUtil{
    public static <T extends Serializable> TableDataInfo<T> pageResultHandleNoConvert(List<T> list) {
        PageInfo<T> pageInfo = new PageInfo<>(list); // 确保 PageInfo 的泛型类型与方法一致
        TableDataInfo<T> tableDataInfo = new TableDataInfo<>();
        tableDataInfo.setTotal(pageInfo.getTotal());
        tableDataInfo.setRows(pageInfo.getList());
        tableDataInfo.setCode(200);
        tableDataInfo.setMsg("success");
        return tableDataInfo;
    }
}